package reservation;

import modelsa.Connection;

import java.util.ArrayList;
import java.util.List;

public class CityHours {

    public static List<Integer> getHoursForConnection(Connection connection) {
        final List<Integer> list = new ArrayList<Integer>();
        final int startHour = connection.getStartHour();
        final int endHour = connection.getEndHour();
        final int diffHour = connection.getDiffHour();
        final int minutesInHour = connection.getMinutesInHour();
        final int connectionNumber = ((endHour - startHour) / diffHour) + 1;
        int value = startHour * 60 + minutesInHour;
        for (int i = 0; i < connectionNumber; i++) {
            list.add(value);
            value += diffHour * 60;
        }
        return list;
    }
}
